using UnityEngine;
using System.Collections;

public class Borracha : MonoBehaviour 
{
	
	float PosiX, PosiY;
	float adc = 0.1f;
	

	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		
		
		mover ();
		transform.position = new Vector3(PosiX,PosiY,0);
		
		
	
	}
	
	void mover()
	{
		
		if(transform.position.x >= 10 )
		{
			transform.rotation = Quaternion.Euler(new Vector3(0,0,-175));
			adc = -0.1f;
		}
		
		if(transform.position.x <= -10)
		{
			transform.rotation = Quaternion.Euler(new Vector3(0,0,175));
			adc = 0.1f;
		}
			
			
			
		
		
		
		
		
		
		PosiX += adc;
		PosiY-= 0.01f;
	}
}
